<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Title</title>
</head>
<body>

<div id="app">
    <button v-on:click="sayHi">click me</button>
</div>

<!--1.导入vue.js-->
<script src="https://cdn.jsdelivr.net/npm/vue@2.5.21/dist/vue.min.js"></script>
<script>
    var vm = new Vue({
        el: "#app",
        // Model：数据
        data: {
            message: '狂神说Java'
        },
        methods: { // 方法必须定义Vue的Methods
            sayHi: function (event){
                alert(this.message)
            }
        }

    });
</script>
</body>
</html>